# knowledge/query/__init__.py

"""
知识库查询引擎模块
负责查询处理、结果检索和响应生成
"""

from knowledge.query.kb_query_engine import KBQueryEngine

__all__ = [
    "KBQueryEngine",
]

class QueryError(Exception):
    """查询异常"""
    pass

class RetrievalError(Exception):
    """检索异常"""
    pass

class ResponseGenerationError(Exception):
    """响应生成异常"""
    pass

# 查询配置
QUERY_CONFIG = {
    "default_similarity_top_k": 3,
    "response_modes": ["compact", "refine", "tree_summarize"],
    "streaming_modes": [True, False]
}

# 过滤器类型
FILTER_TYPES = {
    "folder": "按文件夹过滤",
    "file_type": "按文件类型过滤", 
    "max_depth": "按层级深度过滤",
    "date_range": "按日期范围过滤"
}

# 导出常量和异常
__all__.extend([
    "QueryError",
    "RetrievalError",
    "ResponseGenerationError",
    "QUERY_CONFIG",
    "FILTER_TYPES",
])

# print("✅ 知识库查询引擎模块已加载")
